<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box{
            width: 500px;
            height: 500px;
            border: 2px solid rosybrown;
        }
    </style>
    </head>
    <body>
        <input type="text" id="user">&nbsp;
            <button onclick="fu()" id="fuzhi">复制</button>
                <div id="box">

                </div>
             <script>
            var user =document.querySelector('#user');
            var fuzhi =document.querySelector('#fuzhi');
            function fu() {
            console.log(user.value);
            document.getElementById('box').innerHTML = 
            '<h1>'+user.value+'</h1>';
            username.value = '';
        }

    </script>
</body>
</html>